<form class="layui-form seller-form" action="">
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li><a href="{:url('userSort')}">钱包日志查询</a></li>
            <li><a href="{:url('userTran')}">消费日志(银12)</a></li>
            <li><a href="{:url('userTranDiff')}">消费日志(银3)</a></li>
            <li class="layui-this"><a href="{:url('userUpdate')}">Flag(N=>X)</a></li>
            <li><a href="{:url('xfCardAmount')}">重查卡余额</a></li>
            <li><a href="{:url('addCashError')}">用户余额错误手动添加</a></li>
        </ul>
        <div class="layui-tab-content">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>
                    <a href="javascript:;" style="color: #428bca;font-weight:bold;" >修改消费日志类型'N'=>'X'
                </legend>
            </fieldset>
            <br/>
            <br/>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">消费id：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="tran_id"
                               lay-verify="required_en" maxlength="100"
                               lay-verType="tips"  class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">卡号：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="card_num"
                               lay-verify="required_en" maxlength="100"
                               lay-verType="tips"  class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item" style="padding-top: 100px;">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" lay-submit lay-filter="save">confirm</button>
                </div>
            </div>
        </div>
    </div>
</form>

<script>
    layui.use(['form'], function () {
        var form = layui.form;

        form.on('submit(save)', function(data){
            JsPost("{:url('userUpdate')}", data.field, function(res){
                if (res.code > 0) {
                    layer.msg(res.msg, {time: 1500, icon: 1}, function () {
                        window.location.href = "{:url('userUpdate')}";
                    });
                } else {
                    layer.msg(res.msg, {time: 1500, icon: 2});
                }
            });
        });
    });
</script>
